// The functions contained in this file are pretty dummy
// and are included only as a placeholder. Nevertheless,
// they *will* get included in the shared library if you
// don't remove them :)
//
// Obviously, you 'll have to write yourself the super-duper
// functions to include in the resulting library...
// Also, it's not necessary to write every function in this file.
// Feel free to add more files in this project. They will be
// included in the resulting library.
#include "FreeWay.h"
#include <iostream>

extern "C"
{
    // A function to initialize this shared lib
        bool FreeWayInit(void * brainPtr , int type)
        {


            //logPtr = new FreeWayLog();
            //logPtr->init_log();
     // Initialize Google's logging library.




            LOG(INFO) << "FreeWayInit1.02";




            mgrPtr = new FreeWayMgr();


            mgrPtr->init(brainPtr,type);


            return true;

        }

        // A function to process data (transfer data)  broadcast version
        bool FreeWaySendData(const char * buf, int length)
        {
            LOG(INFO) << "send-1";
            mgrPtr->send2Client(buf,length);
            return true;

        }



        // A function to process command
        bool FreeWaySendCmd(const char * buf , int length)
        {
            return true;

        }
        // A function to reload configuration file
        bool FreeWayReload()
        {
            LOG(INFO) << "FreeWayReload";
            return true;

        }
        // A function to quit
        bool FreeWayExit()
        {

            delete mgrPtr;
            return true;

        }

        //A function to start
        bool FreeWayStart()
        {
           // logPtr->init_log();

            LOG(INFO) << "FreeWaystart";
            mgrPtr->start();
            return true;
        }


}
